﻿Public Class frmEliminar

    Dim Bitacora As New clsActividad

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        OpenFileDialog1.ShowDialog()
        TextBox1.Text = OpenFileDialog1.FileName

    End Sub

    Private Sub Borra_Archivos_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        OpenFileDialog1.Filter = "Archivos PDF (*.pdf)|*.pdf"
        OpenFileDialog1.InitialDirectory = "\\192.168.254.252\Envios PDF\Red PDFS"
        OpenFileDialog1.Multiselect = True
    End Sub

    Private Sub RadButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadButton1.Click
        Dim hora As String = Hour(Now) & Minute(Now) & Second(Now)
        Dim nombre As String
        nombre = OpenFileDialog1.SafeFileName
        If TextBox1.Text = "" Then
            MsgBox("Debes indicar un archivo", MsgBoxStyle.Exclamation)
        Else
            For Each File In OpenFileDialog1.FileNames
                My.Computer.FileSystem.DeleteFile(File)
                'regitrar actividad
                Bitacora.RegistraActividad("Borro archivo " & nombre)
            Next File
            TextBox1.Clear()
        End If
    End Sub

    Private Sub toolGuardar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles toolGuardar.Click
        TextBox1.Text = ""
    End Sub

    Private Sub RadButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
    End Sub

    Private Sub toolSalir_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
    End Sub

    Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
        Me.Close()
    End Sub
End Class